package com.xyhy.core.utils.jdk;

import cn.hutool.core.collection.CollUtil;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author robert
 * @since 2025-05-26
 */
public class OptionalUtil {

  public static <T, R> R getOrNull(T t, Function<T, R> fn) {
    return Optional.ofNullable(t).map(fn).orElse(null);
  }


}
